import Taro from "@tarojs/taro";
const defaultCallback = () => {};
export function setS(key, data, callback = defaultCallback) {
  Taro.setStorage({
    key,
    data,
    success: (CallbackResult) => {
      callback(CallbackResult);
    },
  });
}

export function getS(key, callback = defaultCallback) {
  Taro.getStorage({
    key,
    success: (CallbackResult) => {
      callback(CallbackResult.data);
    },
  });
}

export function delS(key, callback = defaultCallback) {
  Taro.removeStorage({
    key,
    success: (CallbackResult) => {
      callback(CallbackResult);
    },
  });
}
